package com.qf.config;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.rabbit.connection.Connection;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * RabbitMQ通道初始化
 * @author zhaojian
 */
@Configuration
public class ChannelConfig {

    @Bean
    public Channel getRabbitMqChannel(ConnectionFactory factory) {
        Connection connection = factory.createConnection();
        Channel channel = connection.createChannel(false);
        return channel;
    }
}
